import React from 'react';
import Search from './components/Search';
import List from './components/List';

export default class App extends React.Component {
  state = {
    userList: [],
    isFirst: true,
    isLoading: false,
    err: ''
  };
  updateState = stateObj => {
    this.setState(stateObj);
  };
  render() {
    return (
      <div className="container">
        <Search getUsers={this.updateState}></Search>
        <List {...this.state}></List>
      </div>
    );
  }
}
